<template>
  <div>
    <m-header :seller="seller"></m-header>
    <div class="tabs" border-1px>
      <div class="item">
        <router-link tag="div" to="/">商品</router-link>
      </div>
      <div class="item">
        <router-link tag="div" to="/ratings">评论</router-link>
      </div>
      <div class="item">
        <router-link tag="div" to="/seller">商家</router-link>
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
import axios from 'axios'
import MHeader from './components/header/Header'
export default {
  name: 'App',
  components: {
    MHeader
  },
  data () {
    return {
      seller: {}
    }
  },
  mounted () {
    this.loadData()
  },
  methods: {
    loadData () {
      var _this = this
      axios.get('/api/seller').then(function (res) {
        var data = res.data.data
        _this.seller = data
      })
    }
  }
}
</script>
<style lang="stylus" scoped>
@import "common/stylus/mixin.styl"
.router-link-exact-active
  color:rgb(240,20,20)
.tabs
  display:flex
  height:40px
  line-height:40px
  font-size:14px
  border-1px(rgba(7,17,27,0.1))
  .item
    flex:1
    text-align:center
</style>
